package com.example.apipassenger.remote;

import com.example.internalcommon.dto.OrderInfo;
import com.example.internalcommon.dto.ResponseResult;
import com.example.internalcommon.request.OrderRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @Author lyra
 * @Date 2023/4/20 10:24
 **/
@FeignClient("service-order")
public interface ServiceOrderClient {

    @RequestMapping(method = RequestMethod.POST,value = "/order/add")
    ResponseResult add(@RequestBody OrderRequest orderRequest);

    @RequestMapping(method = RequestMethod.GET,value = "/test-real-time-order/{orderId}")
    String dispatchRealTimeOrder(@PathVariable("orderId")long orderId);

    @RequestMapping(method = RequestMethod.POST,value = "/order/cancel")
    ResponseResult cancel(@RequestParam String orderId,@RequestParam String identity);

    @RequestMapping(method = RequestMethod.GET, value = "/order/detail")
    ResponseResult<OrderInfo> detail(@RequestParam String orderId);

    @RequestMapping(method = RequestMethod.GET, value = "/order/current")
    ResponseResult current(@RequestParam String phone ,@RequestParam String identity);

}
